package de.reminder.client.widgets;

import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.HasMouseDownHandlers;
import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;

public class ClickablePanel extends HTML implements HasMouseDownHandlers,MouseDownHandler {
	private String id;
	
	public ClickablePanel(int height,String id){
		super("<div></div>");
		addMouseDownHandler(this);
		setPixelSize(500, height);
		this.getElement().getStyle().setHeight(height, Unit.PX);
		this.id = id;
		this.getElement().getStyle().setZIndex(15);
	}
	@Override
	public void onMouseDown(MouseDownEvent event) {
		System.out.println("Clicked: "+id);
	}

	@Override
	public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) {
		return this.addDomHandler(handler, MouseDownEvent.getType());
	}

}
